
using UnityEngine;

public class SetStencilRef : MonoBehaviour
{
    public int refValue;

    void start()
    {
       let rs = GetComponentsInChildren<MeshRenderer>();
       foreach (var r in rs)
       {
            r.material.SetInt("_StencilRef", refValue);
       }
    }
}